<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
		// 箭头函数的this指向的是函数的上一层作用域的this
		// 不能作为构造函数 
		/* var age = 50;
		var obj = {
			age:18,
			grow:()=>{
				setInterval(()=>{
					this.age++;
					console.log(this.age);
				},3000)
			}
		} */
		// obj.grow();
		// var grow = obj.grow;
		// window.grow()
		
		var arr = [2,4,6,7,8];
		// 过滤出大于5的数
		var  arr1 = arr.filter(item => item>5);
		// console.log(arr1)
		var total = arr.reduce((a,b)=>a+b);
		console.log(total);
		
		var arr2 = arr.map(item=>item*2);
		console.log(arr2)
		</script>
	</body>
</html>
